<template>
	<view class="success-page">
		<!-- 自定义导航栏 -->
		<view class="nav-bar" :style="{ paddingTop: statusBarHeight + 'px' }">
			<view class="nav-content">
				<view class="nav-back" @click="goBack">
					<text class="back-icon">‹</text>
				</view>
				<text class="nav-title">添加成功</text>
				<view class="nav-right">
					<text class="nav-icon">⋯</text>
					<text class="nav-icon">○</text>
				</view>
			</view>
		</view>

		<!-- 内容区域 -->
		<view class="content-area">
			<!-- 成功图标 -->
			<view class="success-icon">
				<view class="icon-circle">
					<text class="checkmark">✓</text>
				</view>
			</view>
			
			<!-- 成功文字 -->
			<text class="success-text">添加成功</text>
			
			<!-- 返回按钮 -->
			<button class="return-btn" @click="goBack">返回</button>
		</view>
	</view>
</template>

<script setup>
	import {
		onLoad
	} from '@dcloudio/uni-app';
	import {
		ref
	} from 'vue';

	// 状态栏高度
	const statusBarHeight = ref(0);

	// 返回我的车辆页面
	const goBack = () => {
		// 返回两级，跳过添加车辆页面，直接回到我的车辆页面
		uni.navigateBack({
			delta: 2
		});
	};

	onLoad(() => {
		// 获取状态栏高度
		const systemInfo = uni.getSystemInfoSync();
		statusBarHeight.value = systemInfo.statusBarHeight;
	});
</script>

<style scoped>
	.success-page {
		background-color: #f5f5f5;
		min-height: 100vh;
	}

	/* 导航栏 */
	.nav-bar {
		background-color: #007AFF;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 1000;
	}

	.nav-content {
		height: 44px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
	}

	.nav-back {
		width: 60rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.back-icon {
		color: #fff;
		font-size: 48rpx;
		font-weight: 300;
		line-height: 1;
	}

	.nav-title {
		color: #fff;
		font-size: 36rpx;
		font-weight: 500;
		flex: 1;
		text-align: center;
	}

	.nav-right {
		display: flex;
		align-items: center;
		gap: 20rpx;
	}

	.nav-icon {
		color: #fff;
		font-size: 40rpx;
	}

	/* 内容区域 */
	.content-area {
		margin-top: calc(44px + var(--status-bar-height, 0px));
		background-color: #fff;
		border-radius: 20rpx 20rpx 0 0;
		min-height: calc(100vh - 44px - var(--status-bar-height, 0px));
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 60rpx 30rpx;
	}

	/* 成功图标 */
	.success-icon {
		margin-bottom: 40rpx;
	}

	.icon-circle {
		width: 200rpx;
		height: 200rpx;
		border-radius: 50%;
		background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
		display: flex;
		align-items: center;
		justify-content: center;
		box-shadow: 0 8rpx 20rpx rgba(79, 172, 254, 0.3);
	}

	.checkmark {
		font-size: 120rpx;
		color: #fff;
		font-weight: bold;
		line-height: 1;
	}

	/* 成功文字 */
	.success-text {
		font-size: 36rpx;
		color: #333;
		font-weight: 500;
		margin-bottom: 60rpx;
	}

	/* 返回按钮 */
	.return-btn {
		width: 100%;
		max-width: 600rpx;
		height: 88rpx;
		background-color: #007AFF;
		color: #fff;
		border: none;
		border-radius: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
	}
</style>
